project(DMTest) # 工程项目名

#工程项目生成了inc和src两个filter,分别包含了Test\inc\*.h和Test\Src\*.c,*.cpp的代码
file(GLOB ROOT_HEADER 		${CMAKE_CURRENT_SOURCE_DIR}/inc/*.h)
file(GLOB ROOT_SOURCE 		${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp;src/*.c)

source_group("inc" 				FILES 	${ROOT_HEADER})
source_group("src"				FILES 	${ROOT_SOURCE})

#工程项目使用了预编译文件StdAfx.h/.cpp
use_precompiled_header(DMTest
   "${CMAKE_CURRENT_SOURCE_DIR}/inc/StdAfx.h"
   "${CMAKE_CURRENT_SOURCE_DIR}/src/StdAfx.cpp"
  )
  
#-------------------------------------------------------------------------------------------------------------------
#工程项目引用了自身inc以及DMMain的相关头文件
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/inc
					${CMAKE_CURRENT_SOURCE_DIR}/)
include_directories(${PROJDIR}/DmMain/inc
					${PROJDIR}/DmMain/inc/Common;
					${PROJDIR}/DmMain/inc/Common/Template;
					${PROJDIR}/DmMain/inc/Core;
					${PROJDIR}/DmMain/inc/Core/Msg;
					${PROJDIR}/DmMain/inc/Core/Dui;
					${PROJDIR}/DmMain/inc/Core/Event;
					${PROJDIR}/DmMain/inc/IDmMain;
					${PROJDIR}/DmMain/inc/Modules;
					${PROJDIR}/DmMain/inc/Widgets;)
		
#-------------------------------------------------------------------------------------------------------------------	
#工程项目输出为MTD方式，使用UNICODE	
if(USE_ALLMT_)
set(CMAKE_CXX_FLAGS_DEBUG "/D_DEBUG /MTd /Zi /Ob0 /Od /RTC1")
set(CMAKE_CXX_FLAGS_RELEASE "/MT /O2 /Ob2 /D NDEBUG")
set(CMAKE_CXX_FLAGS_MINSIZEREL "/MT /O1 /Ob1 /D NDEBUG")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MT /Zi /O2 /Ob1 /D NDEBUG")
endif()
add_definitions(-DUNICODE -D_UNICODE)  # unicode
add_executable(DMTest  WIN32 ${ROOT};${ROOT_HEADER};${ROOT_SOURCE};)
set_target_properties(DMTest PROPERTIES OUTPUT_NAME "DMTest")

#-------------------------------------------------------------------------------------------------------------------
add_dependencies(DMTest  DmMain) #工程项目依赖于DMMain

 